package com.cond.model;


import java.util.List;
import java.util.Set;

import com.condlist.model.CarCondListVO;

public class CarCondService {

	private CarCondDAO_interface dao;

	public CarCondService() {
		dao = new CarCondDAO();
	}

	public CarCondVO addCarCond( String item, Integer status) {

		CarCondVO carcondVO = new CarCondVO();
		carcondVO.setItem(item);
		carcondVO.setStatus(status);
		dao.insert(carcondVO);

		return carcondVO;
	}

	public CarCondVO updateCarCond(String cond_id, String item, Integer status) {

		CarCondVO carcondVO = new CarCondVO();

		carcondVO.setCond_id(cond_id);
		carcondVO.setItem(item);
		carcondVO.setStatus(status);
		dao.update(carcondVO);

		return carcondVO;
	}

	public void deleteCarCond(String cond_id) {
		dao.delete(cond_id);
	}

	public CarCondVO getOneCarCond(String cond_id) {
		return dao.findByPrimaryKey(cond_id);
	}

	public List<CarCondVO> getAll() {
		return dao.getAll();
	}

	public Set<CarCondListVO> getCondlistByCond_id(String cond_id) {
		
		return dao.getCondlistByCond_id(cond_id);
	}
}
